package com.zxjbyte.yiyi.module.system.enums;

import com.zxjbyte.yiyi.framework.common.core.ObjectArrayFactory;
import com.zxjbyte.yiyi.framework.common.enums.CommonEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 字典类型枚举
 *
 * @Author zhangxingjia
 * @Date 2024/10/31 16:24
 * @Version: 1.0
 */
@Getter
@AllArgsConstructor
public enum DictTypeEnum implements CommonEnum<Integer>, ObjectArrayFactory {

    // 系统字典
    SYSTEM_DICT(0),

    // 业务字典
    BIZ_DICT(1),
    ;

    private final Integer code;

    @Override
    public Object[] array() {
        return Arrays.stream(values()).map(DictTypeEnum::getCode).toArray(Integer[]::new);
    }
}
